<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Admin Home</title>
<?php echo $Html->css( 'adminstyle'); ?>
<meta http-equiv="Content-Type" content="text/html; charset=URF-8">
<script type="text/javascript">
<!--
    function showhide(id) {
       var e = document.getElementById(id);
       var img = 'img'+id;
       if(e.style.display == 'block'){
          e.style.display = 'none';
		  document[img].src = "<?php echo $Url->img_src('images/expanse.gif'); ?>";
		}
       else{
          e.style.display = 'block';
		  document[img].src = "<?php echo $Url->img_src('images/collapse.gif'); ?>";
		}
    }
//-->
</script>
</head>
<body>
<!-- Header section -->
<div id="header1" align="right"><a href="<?php $Url->href( 'user/logout'); ?>"><img src="<?php echo $Url->img_src('images/stop.png'); ?>" border="0" align="absmiddle" width="14" />&nbsp;LOGOUT</a></div>
<div id="header"><img src="<?php echo $Url->img_src('images/logo.gif'); ?>" alt="" width="278" height="53" title="24H Framework Powered"></div>
<!-- Left menus -->
<table width="100%" border="0" cellspacing="0" cellpadding="1">
  <tr>
    <td valign="top" width="200" style="padding-top:5px; padding-left:5px;">
		<div id="colexp" style="width:100%; border:dotted 1px #194C7F; margin:0px 0px 3px 0px; padding:5px 0px 5px 0px;"></div>
		<?php
		$strID = '';
		if(is_array($arrMenu)){
			$hasChild = false;
			foreach($arrMenu as $key => $val) {
				if($val['menu_active'] == 1){
					if(sizeof($val['children']) > 0){
						$hasChild = true;
					}
					else{
						$hasChild = false;
					}
		?>
		<!-- MENU -->
		<div id="left">
			<div class="cattop" <?php if($hasChild){ ?>onclick="showhide('subcat<?php echo $val['menu_id']; ?>');"<?php }else{} ?>>
			<img src="<?php echo $Url->img_src( 'images/'.($hasChild ? 'expanse.gif' : 'collapse.gif')); ?>" border="0" align="absmiddle" name="imgsubcat<?php echo $val['menu_id']; ?>" />&nbsp;
			<?php 
			if($val['menu_link'] != '') { 
				echo '<a href="'.$Url->href( $val['menu_link'].'?ocm_menu_id='.$val['menu_id'], false).'">'.$val['menu_name'].'</a>';
			} else { 
				echo $val['menu_name'];
			} 
			?>
			</a>
			</div>
			<?php
				if($hasChild){
					$strID .= $val['menu_id'].',';
					echo '<div id="subcat'.$val['menu_id'].'" style="display:none;">';
					foreach($val['children'] as $child_key => $child_val){
						if($child_val['menu_active'] == 1){
			?>
			<!-- SUBMENU -->
			<div class="sublink"><a class="topbar" href="<?php $Url->href( $child_val['menu_link'].'?comMenu_id='.$val['menu_id']); ?>">&middot;&nbsp;<?php echo $child_val['menu_name']; ?></a></div>
			<!-- SUBMENU -->
				<?php
						}
					}
					echo '</div>';
				}
				?>
		</div>
		<!-- MENU -->
		<?php
				}
			}
		}
		$strID = substr($strID, 0, strlen($strID)-1);
		?>
	<script language="javascript" type="text/javascript">
		function doMenu(opt){
			var arrMenu = new Array(<?php echo $strID; ?>);
			var i = 0;
			
			for(i = 0; i <= (arrMenu.length)-1; i++){
				if(opt == 'exp'){
					document.getElementById('subcat'+arrMenu[i]).style.display='block';
					document['imgsubcat'+arrMenu[i]].src = "<?php echo $Url->img_src( 'images/collapse.gif'); ?>";
				}
				else{
					document.getElementById('subcat'+arrMenu[i]).style.display='none';
					document['imgsubcat'+arrMenu[i]].src = "<?php echo $Url->img_src( 'images/expanse.gif'); ?>";
				}
			}
		}
		var inn = document.getElementById('colexp');
		inn.innerHTML="<a href=\"javascript:void(0)\" style=\"font-size:11px; padding-left:3px;\" onclick=\"doMenu('exp');\"><img src=\"<?php echo $Url->img_src( 'images/expanse.gif'); ?>\" border=\"0\" align=\"baseline\" />&nbsp;Mở hết</a>&nbsp;|&nbsp;<a href=\"javascript:void(0)\" style=\"font-size:11px; padding-left:3px;\" onclick=\"doMenu('col');\"><img src=\"<?php echo $Url->img_src( 'images/collapse.gif'); ?>\" border=\"0\" align=\"baseline\" />&nbsp;Đóng hết</a>";
	</script>
	<!--
	<a href="javascript:void(0)" style="font-size:11px;" onclick="doMenu('exp');"><img src="<?php echo const_Static_Data_Url; ?>images/expanse.gif" border="0" align="baseline" />&nbsp;Mở hết</a> |
	<a href="javascript:void(0)" style="font-size:11px;" onclick="doMenu('col');"><img src="<?php echo const_Static_Data_Url; ?>images/collapse.gif" border="0" align="baseline" />&nbsp;Đóng hết</a>
	-->
	</td>
    <td valign="top"><div id="main">
        <table width="100%" align="center" border="0" cellpadding="0" cellspacing="0">
          <tbody>
            <tr>
              <td width="100%">
			  <?php echo $masterContent; ?>
			  </td>
            </tr>
          </tbody>
        </table>
      </div></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
</table>
<!-- main content -->
<div align='right'>OCM 7.0</div>
</body>
</html>
